import request from '@/utils/request'

export function fetchList(query) {
  return request({
    url: '/api/media/list',
    method: 'get',
    params: query
  })
}

export function exportMedia() {
  return request({
    url: '/api/media/export',
    method: 'post',
    responseType: 'blob'
  })
}

export function fetchMedia(id) {
  return request({
    url: '/api/media/detail',
    method: 'get',
    params: { id }
  })
}

export function createMedia(data) {
  return request({
    url: '/api/media/create',
    method: 'post',
    data
  })
}

export function deleteMedia(data) {
  return request({
    url: '/api/media/delete',
    method: 'post',
    data
  })
}

export function updateArticle(data) {
  return request({
    url: '/api/article/update',
    method: 'post',
    data
  })
}
